package main

import (
	"fmt"
	"regexp"
	"strconv"
	"strings"
)

func main() {
	var (
		formula       = ""
		con     int64 = 0
		val     int64 = 0
	)
	_, _ = fmt.Scanln(&formula)

	split := strings.Split(formula, "=")
	dcon, dval, alpha := count(split[0], false)
	con += dcon
	val += dval

	if alpha == "" {
		dcon, dval, alpha = count(split[1], true)
	} else {
		dcon, dval, _ = count(split[1], true)
	}

	con += dcon
	val += dval
	ans := float64(con) / float64(val)
	if ans == -0.0 {
		ans = 0
	}
	fmt.Printf("%s=%.3f", alpha, ans)
}

func count(side string, reverse bool) (con, val int64, alpha string) {
	var muti int64 = 1
	if reverse {
		muti = -1
	}
	split := regexp.MustCompile("[+-]").Split(side, -1)
	for i, piece := range split {
		var (
			index       = 0
			sig   int64 = 1
		)
		if len(piece) == 0 {
			continue
		}
		for _, s := range split[:i] {
			index += len(s) + 1
		}
		if index > 0 && side[index-1] == '-' {
			sig = -1
		}
		if piece[len(piece)-1] >= uint8('a') {
			alpha = string(piece[len(piece)-1])
			dval, _ := strconv.ParseInt(piece[:len(piece)-1], 10, 64)
			if len(piece) == 1 {
				dval = 1
			}
			val += dval * muti * sig
		} else {
			dcon, _ := strconv.ParseInt(piece, 10, 64)
			con += -1 * dcon * muti * sig
		}
	}
	return
}
